#include <stdio.h>
#include "main.h"
#include "device.h"
#include "select.h"
#include "socket.h"
#include <unistd.h>
#include <stdlib.h>

int g_buttonfd;
int g_ledfd;
int g_mixerfd;
int g_socketfd;

int main()
{
	printf("this is cons out \n");
	int ret = 0;
	// init driver 模拟运下不存在物理按键 使用终端代替
	/* 
	ret = InitDriver();// open driver file
	if (FAILURE == ret)
	{
		printf("打开设备文件 出错\n");
		exit(1);
	}*/

	// 初始化网络
	ret = InitSocket();
	if (FAILURE == ret)
	{
		printf("初始化网络 出错\n");
		exit(2);
	}

	// 进多任务的句柄监听 加入 select
	m_select();

	// 等待子线程的结束
	while(1);

	

}
